//
//  PlayerNames.h
//  ScorePad
//
//  Created by Andy on 08/09/2010.
//  Copyright 2010 Mister Smith's Maevellous Mechanical Software Company. All rights reserved.
//

#import <UIKit/UIKit.h>

@protocol PlayerNamesViewDelegate;

@interface PlayerNamesViewController : UIViewController <UITextFieldDelegate>{

	id <PlayerNamesViewDelegate> delegate;

	NSArray *playerNames;
	NSNumber *numberOfPlayers;
	
	UISegmentedControl *numberOfPlayersButton;
	
	UILabel *label1;
	UITextField *name1;
	UILabel *label2;
	UITextField *name2;
	UILabel *label3;
	UITextField *name3;
	UILabel *label4;
	UITextField *name4;
	UILabel *label5;
	UITextField *name5;
	UILabel *label6;
	UITextField *name6;
	UILabel *label7;
	UITextField *name7;
	
	UITextField *activeField;
	
	BOOL keyboardShown;
	
}

@property (nonatomic, assign) id<PlayerNamesViewDelegate> delegate; 

@property (nonatomic, retain) NSArray *playerNames;
@property (nonatomic, retain) NSNumber *numberOfPlayers;

@property (nonatomic, retain) IBOutlet UISegmentedControl *numberOfPlayersButton;

@property (nonatomic, retain) IBOutlet UILabel *label1;
@property (nonatomic, retain) IBOutlet UITextField *name1;
@property (nonatomic, retain) IBOutlet UILabel *label2;
@property (nonatomic, retain) IBOutlet UITextField *name2;
@property (nonatomic, retain) IBOutlet UILabel *label3;
@property (nonatomic, retain) IBOutlet UITextField *name3;
@property (nonatomic, retain) IBOutlet UILabel *label4;
@property (nonatomic, retain) IBOutlet UITextField *name4;
@property (nonatomic, retain) IBOutlet UILabel *label5;
@property (nonatomic, retain) IBOutlet UITextField *name5;
@property (nonatomic, retain) IBOutlet UILabel *label6;
@property (nonatomic, retain) IBOutlet UITextField *name6;
@property (nonatomic, retain) IBOutlet UILabel *label7;
@property (nonatomic, retain) IBOutlet UITextField *name7;

@property (nonatomic, retain) IBOutlet UITextField *activeField;

- (IBAction)numberOfPlayersChanged:(id) sender;
- (void)registerForKeyboardNotifications;
- (void)scrollActiveTextFieldIntoView:(UITextField *)textField;
- (void)horribleHidingMethod;

@end

@protocol PlayerNamesViewDelegate <NSObject>

@optional
- (void)playersDataReturned:(NSArray *)returnedPlayers totalPlayers:(NSNumber *)playersTotal;

@end

